<link rel="stylesheet" type="text/css" href="style.css" />
<style type="text/css">
#warning
{
padding:10px;
margin-bottom:0px;
background-color:#E77471;
border-width:1px;
border-style: solid;
border-color:#A80000;
}
#success
{
padding:10px;
margin-bottom:0px;
background-color:#A8CBD4;
border-width:1px;
border-style: solid;
border-color:#04637A;
}
span.headline 
{
width:50px;
font-weight:bold;
font-size:110%;
color:#e56506;
}

#ui-datepicker-div
{
left: 394px;
}

html
{
background-image: url(<?php echo base_url()."/images/white.gif"; ?>);
background-repeat: repeat-xy;
}

#grey
{
background-color: #E0E0E0;
}

.rightside
{
width:500px;
background-color: #E7EFEF;
border-style:solid;
border-width:1px;
border-color:#ff0000;
padding:10px 0 10px 20px;
align:center;
}
#admin
{
align:center;
}
</style>
<html>
<head>
<title>Admin</title>
	<meta charset="UTF-8" />

        <script type="text/javascript" src="<?php echo base_url(); ?>/jQuery/js/jquery-1.3.2.min.js"></script>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>/lightbox/jquery.lightbox-0.5.css" media="screen" />
        <script type="text/javascript" src="<?php echo base_url(); ?>/lightbox/jquery.lightbox-0.5.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>/jQuery/js/jquery-ui.min.js"></script>


	<link type="text/css" href="<?php echo base_url(); ?>themes/base/jquery.ui.all.css" rel="stylesheet" />	
	<script type="text/javascript" src="<?php echo base_url()."script/"; ?>jquery-1.4.2.js"></script>
	<script type="text/javascript" src="<?php echo base_url()."script/"; ?>jquery.ui.core.js"></script>
	<script type="text/javascript" src="<?php echo base_url()."script/"; ?>jquery.ui.widget.js"></script>
	<script type="text/javascript" src="<?php echo base_url()."script/"; ?>jquery.ui.datepicker.js"></script>
	<link type="text/css" href="<?php echo base_url()."css/"; ?>demos.css" rel="stylesheet" />
	<script type="text/javascript">
	$(function() {
		var dates = $('#from, #to').datepicker({
			defaultDate: "+1w",
			changeMonth: true,
			numberOfMonths: 3,
			onSelect: function(selectedDate) {
				var option = this.id == "from" ? "minDate" : "maxDate";
				var instance = $(this).data("datepicker");
				var date = $.datepicker.parseDate(instance.settings.dateFormat || $.datepicker._defaults.dateFormat, selectedDate, instance.settings);
				dates.not(this).datepicker("option", option, date);
			}
		});
	});
	</script>
	<script type="text/javascript">

  $(document).ready(function(){



    $('#event_start_date').datepicker({

			changeMonth: true,

			changeYear: true

		});

  });

</script>

<script type="text/javascript">

  $(document).ready(function(){



    $('#event_end_date').datepicker({

			changeMonth: true,

			changeYear: true

		});

  });

</script>

</head>
<body>
<!--search for the city first-->

<div id="admin">
				<h2 id="font">Admin Panel - Lel-Ltd</h2><br />
				<a href="../">Lel-Ltd</a>
</div>
<table align="center">
<tr>
<td>
<div class="leftside">
</div>
<div class="rightside">
					<?php	echo form_open('admin_input'); ?>
							<?php if(strcmp($success,"")!=0) {?>
							<p id="success"><?php echo $success; ?></p>
							<?php }?>
							<?php if(strcmp($warning,"")!=0) {?>
							<p id="warning"><?php echo $warning; ?></p>
							<?php }?>
				<table width="75%">
					<tr>
						<td colspan="2"><span class="headline">Search Quotation<br><br></span></td>
					</tr>
<div class="demo">
					<tr>
						<td width="50%">Start Date :</td>
						<td id="right" align=left>
							<input type="text" id="from" name="start_date"/>
						</td>
					</tr>
					<tr>
						<td width="50%">End Date :</td>
						<td align=left>
							<input type="text" id="to" name="end_date"/>
						</td><br><br>
					</tr>
</div>
					<tr>
						<td colspan="2"><?php	echo form_submit('search_quote', 'Search');	?>	</td>
					</tr>
				</table>

				<!--table for quotation search-->				
				<table  width="75%">
					<?php 
						if(isset($quote_list) && count($quote_list))
						{
					?>
							<br />
							<tr>
								<td width="10%" align="center">ID</td>
								<td align="center">Date </td>
								<td align="center">Requester Name </td>
								<td align="center">Phone </td>
								<td></td>
							</tr>
					<?php 
							$i=0;
							foreach($quote_list as $row) 
							{
								if($i%2==1)
								{
					?>
								<tr>
					<?php   	}
								else 
								{
					?>								
								<tr id="grey">
					<?php 		}				?>
									<td align="center"><?php echo $row->quote_id; ?></td>
									<td><?php echo $row->date; ?></td>
									<td><?php echo $row->requester_name; ?></td>
									<td><?php echo $row->phone; ?></td>
									<td><input type="hidden" name="hidden_quote_id" value=<?php echo $row->quote_id; ?> /></td>
									<td><?php	echo form_submit('quotation_detail', 'Detail');	?>	</td>	
								</tr>
					<?php 
								$i++;
							}
						}
					?>
						<br>______________________________________________________
				</table>
				
				
				
				
				
				
				<table width="75%">
					<tr>
						<td colspan="2"><span class="headline">Search City<br><br></span></td>
					</tr>
					<tr>
						<td width="50%">Search City :</td>
						<td align=left><input name="search" type="text" value="<?php echo $search;?>" ></td><br><br>
					</tr>
					<tr>
						<td colspan="2"><?php	echo form_submit('search_city', 'Search');	?>	</td>
					</tr>
				</table>
				<table  width="75%">
					<?php 
						if(isset($search_city_list) && count($search_city_list))
						{
					?>
							<br />
							<tr>
								<td width="10%" align="center">ID</td>
								<td align="center">City </td>
								<td align="center">Province </td>
								<td align="center">Country</td>
								<td></td>
							</tr>
					<?php 
							echo "count($search_city_list):".count($search_city_list);
							for($i=0;$i<count($search_city_list);$i++) 
//							for($search_city_list as $outer_array) 
//							for($outer_array as $inner_array) 
							{
								if($i%2==1)
								{
					?>
								<tr>
					<?php   	}
								else 
								{
					?>								
								<tr id="grey">
					<?php 		}				?>
									<td align="center"><?php echo $search_city_list[$i]['id']; ?></td>
									<td><?php echo $search_city_list[$i]['city']; ?></td>
									<td><?php echo $search_city_list[$i]['prov']; ?></td>
									<td><?php echo $search_city_list[$i]['country']; ?></td>
									<td><input type="hidden" name="hidden_city_id" value=<?php echo $search_city_list[$i]['id']; ?> /></td>
				<!--					<td><?php	echo form_submit('delete_city', 'Delete City');	?>	</td>	-->
									<td><img src="<?php echo base_url()."images/btn_click_here.gif"; ?>" title="Delete this item" style="cursor:pointer" onclick="if(confirm('Are you sure you want to delete the City <?php echo $search_city_list[$i]['city']; ?> ?')) document.location = '<?php echo base_url()."admin_input/delete_city/".$search_city_list[$i]['id']; ?>';"></td>
								</tr>
					<?php 
								
							}
						}
					?>
						<br>______________________________________________________
				</table>
				<table  width="75%">
					<tr>
						<td colspan="2"><span class="headline">Search Province/State<br><br></span></td>
					</tr>
					<tr>
						<td width="50%">Search Province/State :</td>
						<td align=left><input name="search_province_state" type="text" value="<?php echo $search_province;?>" ></td><br><br>
					</tr>
					<tr>
						<td colspan="2"><?php	echo form_submit('search_province', 'Search');	?>	</td>
					</tr>
				</table>
				<table>
					<?php 
						if(isset($search_province_list) && count($search_province_list))
						{
					?>
							<tr>
								<td width="10%" align="center">ID</td>
								<td width="50%" align="center">Province/State </td>
								<td width="20%" align="center">Country</td>
								<td></td>
							</tr>
					<?php 
							echo "count($search_province_list):".count($search_province_list);
							for($i=0;$i<count($search_province_list);$i++) 
							{
								if($i%2==1)
								{
					?>
								<tr>
					<?php   	}
								else 
								{
					?>								
								<tr id="grey">
					<?php 		}				?>
									<td align="center"><?php echo $search_province_list[$i]['id']; ?></td>
									<td><?php echo $search_province_list[$i]['province']; ?></td>
									<td><?php echo $search_province_list[$i]['country']; ?></td>
									<td><input type="hidden" name="hidden_province_id" value=<?php echo $search_province_list[$i]['id']; ?> /></td>
		<!--						<td><?php	echo form_submit('delete_province', 'Delete Province');	?>	</td>	-->
<td><img src="<?php echo base_url()."images/btn_click_here.gif"; ?>" title="Delete this item" style="cursor:pointer" onclick="if(confirm('Are you sure you want to delete Province/State <?php echo $search_province_list[$i]['province']; ?> ?')) document.location = '<?php echo base_url()."admin_input/delete_province/".$search_province_list[$i]['id']; ?>';"></td>
								</tr>
					<?php 
							}
						}
					?>
				</table>
				<table  width="75%">
					<tr>
						<td><?php if(strcmp($city_exists,"")!=0) {?>
							<p id="reminder"><?php echo $city_exists; ?></p>
							<?php }?>
						</td>
					</tr>
					<tr>
						<td colspan="2"><span class="headline">Add City<br><br></span></td>
					</tr>
					<tr>
						<td width="50%">Add City :</td>
						<td align=left><input name="city" type="text" value="<?php echo $city;?>" ></td><br><br>
					</tr>
					<tr>
						<td>Province/State:</td>
						<td><?php	echo form_dropdown('province_list', $province_list);  ?></td>
					</tr>
					<tr>
						<td colspan="2"><?php	echo form_submit('add_city', 'Add City');	?>	</td>
					</tr>
					<br>______________________________________________________
				</table>
				<table  width="75%">
					<tr>
						<td><?php if(strcmp($province_exists,"")!=0) {?>
							<p id="reminder"><?php echo $reminder_province; ?></p>
							<?php }?>
						</td>
					</tr>
					<tr>
						<td colspan="2"><span class="headline">Add Province/State<br><br></span></td>
					</tr>
					<tr>
						<td width="50%">Add Province :</td>
						<td align=left><input name="province_state" type="text" value="<?php echo $province_state;?>" ></td><br><br>
					</tr>
					<tr>
						<td>Country :</td>
						<td align=left>
							<SELECT NAME="country">
								<OPTION VALUE="">
								<OPTION VALUE="c1">Canada
								<OPTION VALUE="c2">USA
							</SELECT>
						</td>

<!--					<td align=left><input name="country" type="text" value="<?php echo $country;?>" ></td>		-->
					</tr>
					<tr>
						<td colspan="2"><?php	echo form_submit('add_province', 'Add Province/State');	?>	</td>
					</tr>
					<br>______________________________________________________
				</table>

<?php			echo form_close(); ?>
</div>
</td>
</tr>
</table>

</body>
</html>